<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/rateProf.js"></script>
<%@ page import="tuna.Process" %>
<%
	String day = request.getParameter("day");
	String us = request.getParameter("us");
	String role = request.getParameter("role");
	String id = request.getParameter("id");
	String profId = request.getParameter("profId");
	String profName = request.getParameter("profName");
	String courseName = request.getParameter("courseName");
	
	if(Process.validate(day, us, role, id) && (profId != null || !profId.isEmpty()) &&
			(profName != null || !profName.isEmpty()) && (courseName != null || !courseName.isEmpty())) {
		String parameters = "?day=" + day + "&us=" + us + "&role=" + role + "&id=" + id;
%>
	<table align="center" style="font-family: arial; width: 480px; height: 320px">
		<colgroup>
			<col width="100px">
			<col width="380px">
		</colgroup>
		<tr>
			<td>
				Presentation			
			</td>
			<td>
				<input type=radio name="pres" value=0 checked>0
				<input type=radio name="pres" value=1>1
				<input type=radio name="pres" value=2>2
				<input type=radio name="pres" value=3>3
				<input type=radio name="pres" value=4>4
				<input type=radio name="pres" value=5>5
			</td>
		</tr>
		<tr>
			<td>
				Communication			
			</td>
			<td>
				<input type=radio name="comm" value=0 checked>0
				<input type=radio name="comm" value=1>1
				<input type=radio name="comm" value=2>2
				<input type=radio name="comm" value=3>3
				<input type=radio name="comm" value=4>4
				<input type=radio name="comm" value=5>5
			</td>
		</tr>
		<tr>
			<td>
				Explanation			
			</td>
			<td>
				<input type=radio name="exp" value=0 checked>0
				<input type=radio name="exp" value=1>1
				<input type=radio name="exp" value=2>2
				<input type=radio name="exp" value=3>3
				<input type=radio name="exp" value=4>4
				<input type=radio name="exp" value=5>5
			</td>
		</tr>
		<tr>
			<td>
				Teaching			
			</td>
			<td>
				<input type=radio name="teach" value=0 checked>0
				<input type=radio name="teach" value=1>1
				<input type=radio name="teach" value=2>2
				<input type=radio name="teach" value=3>3
				<input type=radio name="teach" value=4>4
				<input type=radio name="teach" value=5>5
			</td>
		</tr>
		<tr>
			<td>
				Workload			
			</td>
			<td>
				<input type=radio name="work" value=0 checked>0
				<input type=radio name="work" value=1>1
				<input type=radio name="work" value=2>2
				<input type=radio name="work" value=3>3
				<input type=radio name="work" value=4>4
				<input type=radio name="work" value=5>5
			</td>
		</tr>
		<tr>
			<td>
				Difficulty			
			</td>
			<td>
				<input type=radio name="diff" value=0 checked>0
				<input type=radio name="diff" value=1>1
				<input type=radio name="diff" value=2>2
				<input type=radio name="diff" value=3>3
				<input type=radio name="diff" value=4>4
				<input type=radio name="diff" value=5>5
			</td>
		</tr>
		<tr>
			<td>
				Learning Experience			
			</td>
			<td>
				<input type=radio name="learn" value=0 checked>0
				<input type=radio name="learn" value=1>1
				<input type=radio name="learn" value=2>2
				<input type=radio name="learn" value=3>3
				<input type=radio name="learn" value=4>4
				<input type=radio name="learn" value=5>5
			</td>
		</tr>
		<tr>
			<td>
				<input type="button" value="Submit" onclick="submitRating('<%= us %>', '<%= id %>', '<%= profId %>');" />
			</td>
			<td>
				<input type="button" value="Back" onclick="location.href='/tuna/listProf.jsp<%= parameters %>'" />
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align: center;">
				<div id="status"></div>
			</td>
		</tr>
	</table>
<% 
	}
	else {
		response.sendRedirect("/tuna/login.jsp");
	}
%>
</body>
</html>